#ifndef DROIDMEDIAPLAYER_DECODER_VIDEO_H
#define DROIDMEDIAPLAYER_DECODER_VIDEO_H


#include "decoder_base.h"

typedef void (*VideoDecodingHandler) (AVFrame*,double);

class DecoderVideo : public DecoderBase {
public:
    DecoderVideo(AVStream *stream);
    ~DecoderVideo();

    VideoDecodingHandler		onDecode;

private:
//    AVFrame* mFrame;
    double mVideoClock;

    bool prepare();
    double synchronize(AVFrame *src_frame, double pts);
    bool decode(void* ptr);
    bool process(AVPacket *packet);

    static int getBuffer(struct AVCodecContext *c, AVFrame *pic, int flags);
    static void	releaseBuffer(struct AVCodecContext *c, AVFrame *pic);
};






#endif //DROIDMEDIAPLAYER_DECODER_VIDEO_H
